package com.showcase.cloud.gateway.feign;

import com.sun.showcase.client.domain.basic.ResourceInfo;
import com.sun.showcase.client.domain.basic.UserInfo;
import com.sun.showcase.pojo.Result;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * UserFeignService 服务降级处理
 */
@Component
public class UserFeignFallbackService implements UserFeignService{
    @Override
    public Result<UserInfo> loadUserByUsername(String userName) {
        Result<UserInfo> r = new Result<UserInfo>();
        r.setSuccess(false);
        r.setMsg("查询用户调用失败");
        return r;
    }

    @Override
    public Result<List<ResourceInfo>> allPermissions(String userId) {
        Result<List<ResourceInfo>> r = new Result<List<ResourceInfo>>();
        r.setSuccess(false);
        r.setMsg("查询权限调用失败");
        return r;
    }
}
